 <html>
 <head>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
     <script type="text/Javascript">
    $(document).ready(function(){ 
	  
              $("#r_button").click(function() {	
				   $(".error").hide();
				});
           $("#s_button").click(function() {
                $(".error").hide();
                var coursename=$("#coursename").val();
                
				 
				  
				 	  
	     if(coursename=="")
	        {
		 
		   $("#blankError").show();
		   return false;
	       }
		   
           });
			
			 });

 </script>
 </head>

<body>
<form name="form3" method="post" action="<?php echo MAIN_URL;?>index.php/loginsuccess/insertcourse">
 
   <label>Course Name</label>
          <input type="text" name="coursename" id="coursename" >
		 <label>Description</label>
     <input type="text" name="description" id="description" >
            
             <input value="Clear" type="reset" id="r_button">
		  <input value="Submit" type="submit" id="s_button">
   <div id="messages" height="200px" width="200px">
  <div class="error" id="result" style="display:none">
   
  </div>
 
  
  <div class="error" style="display:none;" id="blankError">
  <label style='float: left; width: 171px; font-size: 13px;'>
  Enter Course</label>
  </div>
</div>
 
              <?php
               if($this->session->flashdata('course_response'))
                  {
      echo "<label class='error' style='float: left; margin-top: 12px;width: 171px; font-size: 16px; color: #04739D;'>
       Course Added..</label>";
	              unset($_SESSION['course_response']);
	  
                   }?>
   
  
 
</form>
</body>
</html>
                   